home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2010 Summer - Disc 1 / WN_Ete2010_CD1.iso / Onglet5 / Weezo / Weezo setup.exe / {code_appDir} / www / res / bookmarks / std / mobileIndex.php < prev    next >
PHP Script  |  2010-05-19  |  3KB  |  112 lines

  1. <?php
  2. /**
  3.  * RSS feed viewer
  4.  *
  5.  * PHP version 5
  6.  *
  7.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  8.  * that is available through the world-wide-web at the following URI:
  9.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  10.  * the PHP License and are unable to obtain it through the web, please
  11.  * send a note to license@php.net so we can mail you a copy immediately.
  12.  *
  13.  * @category   NA
  14.  * @package    NA
  15.  * @author     Nicolas Bruley / Peer 2 World <contact@weezo.net>
  16.  * @copyright  2005-2009 Nicolas Bruley / Peer 2 World
  17.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  18.  * @version    CVS: $Id:$
  19.  * @link       http://www.weezo.net
  20.  * @since      File available since Release 1.4.0
  21.  */
  22.  
  23. require(INCLUDE_DIR.'mobileFunctions.php');
  24.  
  25. define('THUMBNAILS_SIZE',48);
  26.  
  27. /**
  28.  * @desc Init mobile specific data
  29.  *
  30.  */
  31. function mobileBookmarksInitResourceData(){
  32.     if(cfRGetVar('mobileParametersLoaded')) return;
  33.  
  34.     cfRSetVar('mobileParametersLoaded',1);
  35. }
  36.  
  37.  
  38. /**
  39.  * @desc Insert javascript
  40.  */
  41. function mobileBookmarksInsertScripts(){
  42.     ?>
  43. <script type="text/javascript">
  44. function go(l){window.open(l,"_blank")}
  45. </script>
  46.     <?php
  47. }
  48.  
  49.  
  50. // Init mobile specific data
  51. mobileBookmarksInitResourceData();
  52.  
  53.  
  54. /*
  55.  ***************************************************************************************************************************
  56.  * Insert HEAD, javascripts and comForm
  57.  ***************************************************************************************************************************
  58.  */
  59. mfInsertHead();
  60. outInsertStandardComForm($_SERVER['PHP_SELF']);
  61. mobileBookmarksInsertScripts();
  62.  
  63.  
  64.  
  65. /*
  66.  ***************************************************************************************************************************
  67.  * Generate bookmarks tree (not treeView...) and thumbnails
  68.  ***************************************************************************************************************************
  69.  */
  70. bfGenerateBookmarksTree();
  71. $bookmarks=cfRGetVar('bookmarks');
  72.  
  73.  
  74. $displayThumbnails=cfRGetVar('displayThumbnails');
  75.  
  76. // List table
  77. echo mfListTable();
  78.  
  79. foreach (cfRGetVar('bookmarks') as $k=>$item){
  80.     // Thumbnail
  81.     if($item['type']=='b') {
  82.         // Main link
  83.         $link=$item['url'];
  84.  
  85.         // Title
  86.         $title=cfUTF8Encode($item['name']);
  87.  
  88.         // Thumbnail
  89.         if($displayThumbnails && bfThumbnailFile($item['url'])) {
  90.             $src=cfExtImage(bfThumbnailFile($item['url']),THUMBNAILS_SIZE,THUMBNAILS_SIZE);
  91.             $favicon=0;
  92.         }
  93.         // Or favicon if thumbnail not yet generated or if no thumbnails
  94.         else {
  95.             $src=mfFaviconLink($item['url']);
  96.             $favicon=1;
  97.         }
  98.  
  99.         // No thumbnail yet
  100.         if(!$src) $src=outIcon('loading');
  101.  
  102.         /**
  103.          * Formated list item
  104.          */
  105.         if($favicon)
  106.             echo mfListItem('onclick="go(\''.$link.'\')"','<img src="'.$src.'" class="imgW16">',false,'<div class="lits">'.$title.'</div>'.$link,false,outImage(outIcon('go')),false);
  107.         else
  108.             echo mfListItem('onclick="go(\''.$link.'\')"',outImage($src,false,'class="frLi16"','width:'.THUMBNAILS_SIZE.';height:'.THUMBNAILS_SIZE),false,'<div class="lits">'.$title.'</div>'.$link,false,outImage(outIcon('go')),false);
  109.     }
  110. }
  111. ?>
  112. </table></body></html>